const { http } = uni.$u;
// 登陆
export const login = (params, config = {}) =>
  http.post("/app/login", params, config);
// 获取当前登录用户信息
export const getLoginUser = (params, config = {}) =>
  http.get("/getLoginUser", params, config);
// 获取openId
export const getOpenId = (data) => http.get(`/app/getOpenId?code=${data}`);
// 统计
export const summary = (params, config = {}) =>
  http.post("/homePage/caseSummary", params, config);
// 消息列表
export const allMessage = (params) =>
  http.post(`/homePage/noticeLogForPage`, params);
// 获取图片验证码
export const getCaptcha = (data) =>
  http.get(`/app/getCaptcha?account=${data}`, {
    responseType: "arraybuffer",
    custom: {
      getResponse: true,
    },
  });
// 注册
export const createAccount = (params) =>
  http.post(`/app/createAccount`, params);
// 小程序自动登录
export const autoLogin = (params) => http.get(`/app/autoLogin?openId=${params}`);

export const codeLogin = (params) => http.get(`/app/codeLogin?code=${params}`);
